import bus from "@/bus";

let data = {
  status: 'pass',
  currentPage: 1,
  totalItem: 1,
  pageSize: window.$pageSize,
  form: {
    packageName: ''
  },
  columns: [{
      title: '礼包名称',
      key: 'packageName',
      minWidth: 150
    }, {
      title: '渠道',
      key: 'couponSendChannelEnum',
      minWidth: 150,
      align: 'left',
      render: (h, params) => {
        let list = {
        NONE_LIMIT: "不限",
        TIRE_INSURANCE: "轮胎保小程序",
        CLOUD_APP: "中策云店",
        SALESMAN: "业务通"
        }
        return h('div', list[params.row.couponSendChannelEnum])
      }
    }, {
      title: '操作',
      align: 'right',
      minWidth: 150,
      render: (h, params) => {
        let editBtn = h('Button', {
          props:{
            size:'small',
            type:'primary'
          },
          class: 'mr',
          on: {
            click: () => {
              bus.$emit('onEdit', {id: params.row.id})
            }
          }
        }, '编辑')
        let infoBtn = h('Button', {
          props:{
            size:'small'
          },
          class: 'mr',
          on: {
            click: () => {
              bus.$emit('onInfo', {id: params.row.id})
            }
          }
        }, '详情')
        let delBtn = h('Button', {
          props:{
            size:'small',
            type: 'primary'
          },
          on: {
            click: () => {
              bus.$emit('onDelete', {id: params.row.id, index: params.index})
            }
          }
        }, '删除')
        return h('div', [editBtn, infoBtn, delBtn])
      }
  }],
  data: []
}
export default data;